package com.example.edupublisher.service.imp;

import com.example.edupublisher.bean.TradeProvinceFinalAmount;
import com.example.edupublisher.bean.TradeProvinceOrderCt;
import com.example.edupublisher.mapper.TradeStatsMapper;
import com.example.edupublisher.service.TradeStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;


/**
 * ClassName: TradeStatsServiceImpl
 * Package: com.atguigu.edu.publisher.service.impl
 * Description:
 *
 * @Author Mr.2
 * @Create 2023/9/12 10:57
 * @Version 1.0
 */
@Service
public class TradeStatsServiceImpl implements TradeStatsService {

    // 自动装载 Mapper
    @Autowired
    TradeStatsMapper tradeStatsMapper;

    // 1. 省份 下单数
    @Override
    public List<TradeProvinceOrderCt> getTradeProvinceOrderCt(Integer date) {
        return tradeStatsMapper.selectTradeProvinceOrderCt(date);
    }

    // 2. 省份 下单金额
    @Override
    public List<TradeProvinceFinalAmount> getTradeProvinceFinalAmount(Integer date) {
        return tradeStatsMapper.selectTradeProvinceFinalAmount(date);
    }

    // 3. 某天 下单总金额统计
    @Override
    public BigDecimal getGMV(Integer date) {
        return tradeStatsMapper.selectGMV(date);
    }
}
